Ajax Register - Export

8 years 3 months ago #7585 by hakana
OK the issue seems to be solved by adding this line:
$query->where('block = 0');

Now I need to set the character encoding because the Turkish characters look awful. There can be another parameter where we can set the character encoding in the admin export page. I will work on this to add this manually to the code, but if you would like to improve the export facility, please add the encoding option as well.

Please Log in or Create an account to join the conversation.

8 years 3 months ago - 8 years 3 months ago #7586 by hakana
I could not manage to insert a line with the right encoding.

Another request if possible. Is it possible to modify the SQL so that it capitalizes the first letter of every word in the name field? I think this is the hardest part. This can be also added as an option. Is it possible to add such a line here so that I modify the modal code?

Kind regards.

Please Log in or Create an account to join the conversation.

8 years 3 months ago #7587 by Saka
I think encoding is fine, it's MS Excel's fault if you use it to open the file. Try Google Spreadsheets, it will look fine.

Capitalising directly in SQL would be harder, much easier to do it in PHP:

Line 59:
foreach($rows as $row) {

Replace with:
foreach($rows as &$row) {
	$row->name = ucwords($row->name);

p.s. I don't usually support code modifications, this is for exercise only and will void your warranty. :)

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

8 years 3 months ago - 8 years 3 months ago #7588 by hakana
Hi Emir,

Thank you very much. I also take this current support as co-development of export section if you want to improve it.  :)

Thank you for the capitalization code. I will improve it with support for Turkish characters.

This part is important. I have another component which exports user data with some additional fields in csv format. I never had this Turkish character issue with that. I directly open it in Excel and the characters are OK. Maybe you need to modify the header of the document (view.csv.php). You know better ofcourse. I will try to modify the header and see the results and then inform you.

End of message (EOM) from co-development team  :P

Please Log in or Create an account to join the conversation.

8 years 3 months ago #7590 by hakana
Hi Emir,

You are right about the charset. If you want to open the file in Excel as it is, you can follow these steps:
Excel -> data -> from text

If you follow these steps you import the data as it is without any error in the characters. Maybe you can put this info as a note on the export page.

Kind regards,
Hakan

Please Log in or Create an account to join the conversation.

7 years 10 months ago - 7 years 10 months ago #7701 by hakana
Just a kind update. Instead of
foreach($rows as &$row) {
	$row->name = ucwords($row->name);

This is better for Turkish charasters:
foreach($rows as &$row) {
$row->name = mb_convert_case(str_replace(array('I','i'),array('ı','İ'),$row->name), MB_CASE_TITLE, "UTF-8");

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch